#ifndef PathFind_h__
#define PathFind_h__

#include "../framework/CompileConfig.h"
#include "../infLib/infLib.h"

#if (INF_PLATFORM == PLATFORM_WIN32) || (INF_PLATFORM == PLATFORM_WIN64)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <io.h>
#include <shlobj.h>
#include <direct.h>
#else
#include <glob.h>
#endif


class PathFinder {
public:
    static PathFinder* Create(const char* dir);
    static void Close( PathFinder* finder );


    const inf::Str&	GetStartDir() const;
    inf::Str&		GetStartDir();

    const char*	    GetName() const { return name; }
    bool		    GetNext();
    bool		    IsDir() const	{ return isDir; }
    bool		    IsDots() const	{ return isDots; }

    static bool			DirIsDots( const char *str );
    static bool			IsDir(const char* osPath);
private:
    PathFinder(const char* dir);
    ~PathFinder();
    inf::Str    startDir;

    bool isDir;
    bool isDots;
    const char* name;

    inf::Str nameBuffer;
    int nameOffset;

    int hFind;
    _finddata_t findData;

};

#endif // PathFind_h__
